package com.sopra.tecnica.poc.server.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.sopra.tecnica.poc.server.entity.ItemEntity;
import com.sopra.tecnica.poc.server.service.ItemService;

@Controller
@RequestMapping("item")
public class ItemController {
	
	@Autowired
	private ItemService itemService;
	
	@RequestMapping("order")
	public void findOrderItems(@RequestParam("num") String num,
			Model model) {
		List<ItemEntity> result = itemService.findOrderItems(num);
		model.addAttribute(result);
	}
}
